package com.sz.app;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.util.Locale;

@EnableTransactionManagement
@ServletComponentScan
@SpringBootApplication
@ComponentScan(basePackages={"com.sz"})
@PropertySource(value = {"classpath:/application.properties", "classpath:/i18n-tables.properties"})
public class Application extends SpringBootServletInitializer {

    public static void main(String[] args) {
        Locale.setDefault(new Locale("zh", "CN"));
        SpringApplication.run(Application.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        Locale.setDefault(new Locale("zh", "CN"));
        return application.sources(Application.class);
    }
}